<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\News */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'news'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
    td img {
        max-width: 100%;
    }
</style>
<div class="news-view">

    <p>
        <?= Html::a(Yii::t('common', 'update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('common', 'delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('common', 'are_you_sure_you_want_to_delete_this_item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            //'category_id',
            'title',
            [
                'label' => Yii::t('common', 'litpic'),
                'value' => $model->litpic ? Html::img($model->litpic, ['class' => 'img img-rounded']) : '--',
                'format' => 'raw',
            ],
            'desc:raw',
            'content:raw',
            'author',
            'comefrom',
//            'remark',
            'order',
//            'version',
//            'created_by',
            ['label' => Yii::t('common', 'status'), 'value' => \common\helpers\TStringHelper::getStatusText($model->status)],
            ['label' => Yii::t('common', 'created_at'), 'value' => \common\helpers\TStringHelper::ShowDate($model->created_at)],
//            'created_from',
//            'created_ip',
//            'updated_by',
//            'updated_at',
//            'updated_from',
//            'updated_ip',
//            'is_deleted',
        ],
        'template' => '<tr><th width="150">{label}</th><td>{value}</td></tr>',
    ]) ?>

</div>
